{% extends "base.html" %}
{% block title %}
    职位管理
{% endblock %}
{% block head %}
    <!-- Bootstrap Core CSS -->
    <link href="/static/lib/sb-admin/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="/static/lib/sb-admin/vendor/metisMenu/metisMenu.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="/static/lib/sb-admin/dist/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="/static/lib/sb-admin/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
{% endblock %}
{% block label %}
    <h1 class="page-header">{{ D.D_name }}-职位管理</h1>
    <a class="btn btn-default pull-right" data-toggle="modal" data-target="#add_modal">添加</a>
{% endblock %}
{% block contenter %}
    <div class="row">
        <table class="table">
            <thead>
            <tr>
                <th>职位名称</th>
                <th>职位等级</th>
                <th>职位操作</th>
            </tr>
            </thead>
            <tbody>
            {% for p in pos_list %}
                <tr>
                    <td class="col-lg-4">{{ p.Pos_name }}</td>
                    <td class="col-lg-4">{{ p.level }}</td>
                    <td class="col-lg-4">
                        <a class="btn btn-default" data-toggle="modal" data-target="#edit_modal"
                           href='/oa_system/des_position/{{ p.id }}/'>编辑</a>
                        <a class="btn btn-default" href="#">删除</a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    <div class="modal" id="add_modal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span>&times;</span>
                    </button>
                    <h4>新增职位</h4>
                </div>
                <div class="modal-body">
                    <form method="post">
                        <input type="hidden" name="csrf_token"
                               value="{{ csrf_token() }}">
                        <div class="form-group">
                            <label class="control-label">职位名称：</label>
                            <input class="form-control" type="text" name="name">
                        </div>
                        <div class="form-group">
                            <label class="control-label">职位等级：</label>
                            <input class="form-control" type="number" name="level">
                        </div>
                        <div class="form-group">
                            <button class="btn btn-primary btn-block">提交</button>
                        </div>
                    </form>
                </div>
                <!--
                <div class="modal-footer"></div>
                -->
            </div>
        </div>
    </div>
    <div class="modal" id="edit_modal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span></span>
                    </button>
                    <h4>编辑职位</h4>
                </div>
                <div class="modal-body">
                    <form method="post">
                        <input type="hidden" name="csrf_token"
                               value="{{ csrf_token() }}">
                        <div class="form-group">
                            <label class="control-label">职位名称：</label>
                            <input class="form-control" type="text" name="name" value='{{ Name }}'>
                        </div>
                        <div class="form-group">
                            <label class="control-label">职位等级：</label>
                            <input class="form-control" type="number" name="level" value='{{ Level }}'>
                        </div>
                        <div class="form-group">
                            <button class="btn btn-primary btn-block">提交</button>
                        </div>
                    </form>
                </div>
                <!--
                <div class="modal-footer"></div>
                -->
            </div>
        </div>
    </div>
{% endblock %}
{% block body %}
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script>
        $.ajax({
            type: 'GET',
            data: ''
        })
    </script>
    <script src="/static/lib/sb-admin/vendor/jquery/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="/static/lib/sb-admin/vendor/bootstrap/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="/static/lib/sb-admin/vendor/metisMenu/metisMenu.min.js"></script>

    <!-- Custom Theme JavaScript -->
    <script src="/static/lib/sb-admin/dist/js/sb-admin-2.js"></script>
{% endblock %}
